package kk.controller;

import com.github.pagehelper.PageInfo;
import kk.domain.SysLog;
import kk.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("/sysLog")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(Integer pageNum,Integer pageSize) throws Exception {
        ModelAndView modelAndView=new ModelAndView();
        List<SysLog> sysLogList= sysLogService.findAll(pageNum,pageSize);
        PageInfo pageInfo=new PageInfo(sysLogList);
        modelAndView.addObject("pageInfo",pageInfo);
        modelAndView.setViewName("syslog-list");
        return modelAndView;
    }
}
